package com.dubbo.mapper;

import com.dubbo.domain.Pic;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

/**
 * 图片表mapper
 * @author chenluqiang
 * @date 2018年12月15日 下午5:21:31 
 *
 */
public interface PicMapper extends Mapper<Pic>{
	
	/**
	 * 售后图片
	 * @author chenluqiang
	 * @date 2018年12月18日 上午11:51:18 
	 * @param refundId
	 * @return
	 */
	@Select("SELECT " + 
			"	ppc.url, " + 
			"	ppc.id AS picId " + 
			"FROM " + 
			"	p_pic ppc " + 
			"LEFT JOIN s_refund_pic_key spk ON ppc.id = spk.picId " + 
			"WHERE " + 
			"	spk.refundId = #{refundId}")
	List<Map<String, Object>> getRefundPics(@Param("refundId") String refundId);
}